package com.aruba.daggerapplication.di.module

import com.aruba.daggerapplication.api.BaiduApiService
import com.aruba.daggerapplication.di.scope.MyScope
import dagger.Module
import dagger.Provides
import retrofit2.Retrofit
import retrofit2.converter.scalars.ScalarsConverterFactory

/**
 * 表示一个网络模块
 * Created by aruba on 2021/12/4.
 */
@Module
class NetworkModule {

    @MyScope
    @Provides
    fun getBaiduApiService(): BaiduApiService {
        return Retrofit.Builder()
            .baseUrl("https://www.baidu.com")
            .addConverterFactory(ScalarsConverterFactory.create())
            .build().create(BaiduApiService::class.java)
    }
}